import request from '../../views/components/utils/request.js'

// 查询项目申请列表
export function listExtract(query) {
  return request({
    url: '/unit/extract/list',
    method: 'get',
    params: query
  })
}
// 查询项目申请列表（新建一个项目申请列表接口之前的影响其它地方）
export function listExtractPage(query) {
  return request({
    url: '/unit/extract/page',
    method: 'get',
    params: query
  })
}
// editiExtract
export function editiExtract(query) {
  return request({
    url: '/unit/extract/editi',
    method: 'post',
    params: query
  })
}
// 查询项目申请详细
export function getExtract(extractId) {
  return request({
    url: '/unit/extract/' + extractId,
    method: 'get'
  })
}
// 查询项目申请详细
export function Department(query) {
  return request({
    url: '/unit/extract/department',
    method: 'get',
		params: query
  })
}

// 新增项目申请
export function addExtract(data) {
  return request({
    url: '/unit/extract',
    method: 'post',
    data: data
  })
}


// 新增排除
export function addBanRandom(data) {
  return request({
    url: '/unit/random/addExclude',
    method: 'post',
    data: data
  })
}
// 查看排除理由
export function CheckReason(data) {
  return request({
    url: '/unit/random/export',
    method: 'post',
    data: data
  })
}
//提交项目按钮
export function submit(data) {
  return request({
    url: '/unit/extract/addSubmit',
    method: 'post',
    data: data
  })
}

// 中标确认
export function updateExtract(data) {
  return request({
    url: '/unit/extract',
    method: 'put',
    data: data
  })
}
// 审批确认
export function approvalConfirm(data) {
  return request({
    url: '/unit/random/editList',
    method: 'put',
    data: data
  })
}

export function approvalViewConfirm(data) {
  return request({
    url: '/unit/random',
    method: 'put',
    data: data
  })
}

// 修改项目申请
export function randomSelect(data) {
  return request({
    url: '/unit/random/select',
    method: 'post',
    data: data
  })
}

// 删除项目申请
export function delExtract(extractId) {
  return request({
    url: '/unit/extract/' + extractId,
    method: 'delete'
  })
}

// 导出项目申请
export function exportExtract(query) {
  return request({
    url: '/unit/extract/export',
    method: 'get',
    params: query
  })
}
// 获取报价确认抽取库选项
export function getExtractOption(query) {
  return request({
    url: '/unit/unittype/list',
    method: 'get',
    params: query
  })
}
// 获取报价确认列表数据(单位名称、上传报价)
export function getExtractArticle(query) {
  return request({
    url: '/unit/random/list',
    method: 'get',
    params: query
  })
}
// 获取报价确认列表数据(项目名称经办人)
export function getExtractList(query) {
  return request({
    url: '/unit/extract/list',
    method: 'get',
    params: query
  })
}

// 获取中标确认列表数据
export function getMakeSureList(query) {
  return request({
    url: 'unit/extract/makeSureList',
    method: 'get',
    params: query
  })
}

// 上传报价确认数据接口
export function uploadExtract(query) {
  return request({
    url: '/unit/random',
    method: 'put',
    data: query
  })
}
// 获取项目评价评分数据
export function getScore() {
  return request({
    url: '/system/rubric/list',
    method: 'get'
  })
}
// 保存评分(保存违规扣分接口)
export function saveDeduction(data) {
  return request({
    url: '/system/scoreindex/scoreAdd',
    method: 'post',
    data: data
  })
}

// 查询项目申请列表
export function getLists(query) {
  return request({
    url: '/unit/extract/lists',
    method: 'get',
    params: query
  })
}
// 中标单位确认
export function winningUnitConfirm(data) {
  return request({
    url: '/unit/random/bidding',
    method: 'post',
    data
  })
}
// 扣分
export function deductMarks(data) {
  return request({
    url: '/system/scoreindex',
    method: 'post',
    data
  })
}
// 打印评分表
export function printMark(data) {
  return request({
    url: '/unit/extract/select',
    method: 'post',
    data
  })
}
// 获取表格单位信息
export function getTableCompany(params){
  return request({
    url:'/unit/extract/selcetExtract',
    method:'get',
    params
  })
}
// 项目查看扣分确定
export function shortPoints(data){
  return request({
    url:'/system/scoreindex/scoreInsert',
    method:'post',
    data
  })
}

export function evaluate(data) {
  return request.post("/unit/extract/evaluate", data);
}

export function sureExtract(data) {
  return request.put("/unit/extract/sureExtract", data)
}

export function getScoreindexListByUnitID(params) {
  return request.get("/system/scoreindex/getScoreindexListByUnitID", {params});
}

export function getExtractCharges() {
  return request.get("/unit/extract/selectExtractCharges")
}